{if !$sortby}{ext->get_sortby parent=$data.page.id assign="sortby"}{/if}
{******** GET ELEMENTS BY PAGE *******}
{counter start=0 skip=1 assign="ct"}
{foreach from=$elements_list item="el"}
{counter assign="ct"}
	{if $ct >= $page_data.current_page.from && $ct <= $page_data.current_page.to}
		{assign_array3 key=$ct value=$el assign="paged_elements"}
	{/if}
{/foreach}

{******** SORT BY *******}
{if $paged_elements}
{ext->aasort array=$paged_elements args=$sortby assign="paged_elements"}
{/if}

{******** SHOW ELEMENTS *******}
<div style="padding: 6px;">
{if $paged_elements}
{foreach from=$paged_elements item="el"}
	<div id="childs_id_{$el.id}" style="float:left; border: 2px solid #dbe1e5;">
		{include file="admin/body/elements/image.htm"}
	</div>
{/foreach}
<div style="clear: both;"></div>
{else}
<div style="padding: 15px; text-align: center; background: #FFFFFF;">{t t='Šis puslapis neturi elementų. Sukurkite juos!'}</div>
{/if}
</div>
